package com.gaoyi.crm.db.dao;

import androidx.room.Dao;
import androidx.room.Query;

import com.gaoyi.crm.db.CrmDatabase;
import com.gaoyi.crm.db.entity.PmnAttach;

import java.util.List;

@Dao
public abstract class PmnAttachDao extends BaseDao<PmnAttach> {

    @Query("SELECT `attach` FROM " + CrmDatabase.TABLE_PMN_ATTACH + " WHERE pmnId = :pmnId")
    public abstract List<String> getPmnAttach(String pmnId);

    @Query("DELETE FROM " + CrmDatabase.TABLE_PMN_ATTACH + " WHERE pmnId = :pmnId")
    public abstract void deletePmnAttach(String pmnId);

    @Query("UPDATE "+ CrmDatabase.TABLE_PMN_ATTACH+" SET uploadPath = :path WHERE id = :id")
    public abstract void updateUploadPath(String id,String path);
}
